package com.xianyun.site.iblog.common.database;

import com.xianyun.site.iblog.common.database.domainobject.RocketMqTransactionLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 日志Mapper接口
 *
 * @author ruoyi
 * @date 2020-10-20
 */
@Mapper
public interface RocketMqTransactionLogMapper
{
    /**
     * 新增日志
     *
     * @param rocketMqTransactionLog 日志
     */
    @Select("insert into rocket_mq_transaction_log(transaction_id,log)values(#{transactionId},#{log})")
    void insertRocketMqTransactionLog(RocketMqTransactionLog rocketMqTransactionLog);


    /**
     * 根据事务Id来查询事务编号
     * @param transactionId 事务Id
     * @return 事务记录
     */
    @Select("select id id,transaction_id transactionId ,log log from rocket_mq_transaction_log where transaction_id=#{transactionId}")
    RocketMqTransactionLog selectTransactionLogByTid(String transactionId);
}
